<template>
  <div>
    <el-row :gutter="15">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px"
        label-position="left">
        <el-col :span="24">
          <el-form-item label="下拉选择" prop="field116">
            <el-select v-model="formData.field116" placeholder="请选择下拉选择" clearable :style="{width: '100%'}">
              <el-option v-for="(item, index) in field116Options" :key="index" :label="item.label"
                :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label-width="-1px" label="请假" prop="holidayText">
            <el-input v-model="formData.holidayText" type="textarea" placeholder="请输入请假原因" :maxlength="500"
              :autosize="{minRows: 4, maxRows: 6}" :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="请假时间" prop="timeScope">
            <el-date-picker type="daterange" v-model="formData.timeScope" format="yyyy-MM-dd"
              value-format="yyyy-MM-dd" :style="{width: '100%'}" start-placeholder="开始日期"
              end-placeholder="结束日期" range-separator="至" clearable></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="请假类别" prop="holidayType">
            <el-select v-model="formData.holidayType" placeholder="请选择请假类别" clearable
              :style="{width: '100%'}">
              <el-option v-for="(item, index) in holidayTypeOptions" :key="index" :label="item.label"
                :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
<!--        <el-col :span="12">
          <el-form-item label="按钮" prop="field102">
            <el-button type="primary" icon="el-icon-search" size="medium"> 主要按钮 </el-button>
          </el-form-item>
        </el-col>-->
        <el-col :span="12">
<!--          <el-form-item label="按钮" prop="field114">
            <el-button type="primary" icon="el-icon-search" size="medium"> 主要按钮 </el-button>
          </el-form-item>-->
        </el-col>
        <el-col :span="24">
          <el-form-item size="large">
            <el-button type="primary" @click="submitForm">提交</el-button>
            <el-button @click="resetForm">重置</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
  </div>
</template>
<script>
export default {
  components: {},
  props: [],
  data() {
    return {
      formData: {
        field116: 2,
        holidayText: '',
        timeScope: null,
        holidayType: 2,
        field102: undefined,
        field114: undefined,
      },
      rules: {
        field116: [{
          required: true,
          message: '请选择下拉选择',
          trigger: 'change'
        }],
        holidayText: [{
          required: true,
          message: '请输入请假原因',
          trigger: 'blur'
        }],
        timeScope: [{
          required: true,
          message: '请假时间不能为空',
          trigger: 'change'
        }],
        holidayType: [{
          required: true,
          message: '请选择请假类别',
          trigger: 'change'
        }],
      },
      field116Options: [{
        "label": "选项一",
        "value": 1
      }, {
        "label": "选项二",
        "value": 2
      }],
      holidayTypeOptions: [{
        "label": "病假",
        "value": 0
      }, {
        "label": "事假",
        "value": 1
      }, {
        "label": "婚假",
        "value": 2
      }, {
        "label": "孕假",
        "value": 3
      }],
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>
<style>
</style>
